﻿using System;
using System.Collections.Generic;
using System.Text;

namespace WikiDoc
{
    /// <summary>
    /// a CodeStart line
    /// </summary>
    public class CodeStartLine : WikiLine
    {

        #region 属性

        private string _ParserName;
        /// <summary>
        /// Gets the name of the parser.
        /// </summary>
        /// <value>The name of the parser.</value>
        public string ParserName
        {
            get { return _ParserName; }
        }


        private string _Argv;
        /// <summary>
        /// Gets the argv.
        /// </summary>
        /// <value>The argv.</value>
        public string Argv
        {
            get { return _Argv; }
        }

        #endregion


        /// <summary>
        /// 初始化 <see cref="CodeStartLine"/> 类的新实例.
        /// </summary>
        /// <param name="line"></param>
        /// <param name="parserName"></param>
        /// <param name="argv"></param>
        public CodeStartLine(string line, string parserName, string argv) : base(LineType.CodeStart, line)
        {
            ResetAs(line, parserName, argv);
        }


        /// <summary>
        /// Resets as.
        /// </summary>
        /// <param name="line">The line.</param>
        /// <param name="parserName">Name of the parser.</param>
        /// <param name="argv">The argv.</param>
        /// <returns></returns>
        public CodeStartLine ResetAs(string line, string parserName, string argv)
        {
            if (line == null) throw new ArgumentNullException("line");
            if (parserName == null) throw new ArgumentNullException("parserName");
            if (argv == null) throw new ArgumentNullException("argv");

            Line = line;
            _ParserName = parserName;
            _Argv = argv;

            return this;
        }
    }
}
